import { Component } from 'react';
import React from 'react';
import { connect } from 'umi';
import HighPerformTable from '@/components/HighPerformTable';
import KeywordFilterSearch from '@/components/KeywordFilterSearch';
import { Button } from 'antd';
import { PlusOutlined } from '@ant-design/icons';

class ClassDetailes extends Component<any, any> {
  actionRef: any;

  constructor(props: any) {
    super(props);
  }

  componentDidMount() {}

  clomns: any = [
    {
      title: '姓名',
      dataIndex: 'name',
      rules: [
        {
          required: true,
          message: '规则名称为必填项',
        },
      ],
    },
    {
      title: '学号',
      dataIndex: 'desc',
      valueType: 'textarea',
    },
    {
      title: '班级',
      dataIndex: 'callNo',
      sorter: true,
      hideInForm: true,
      renderText: (val: string) => `${val} 万`,
    },
    {
      title: '年级',
      dataIndex: 'status',
      hideInForm: true,
      valueEnum: {
        0: { text: '关闭', status: 'Default' },
        1: { text: '运行中', status: 'Processing' },
        2: { text: '已上线', status: 'Success' },
        3: { text: '异常', status: 'Error' },
      },
    },
    {
      title: '学院',
      dataIndex: 'status',
      hideInForm: true,
      valueEnum: {
        0: { text: '关闭', status: 'Default' },
        1: { text: '运行中', status: 'Processing' },
        2: { text: '已上线', status: 'Success' },
        3: { text: '异常', status: 'Error' },
      },
    },
    {
      title: '更新时间',
      dataIndex: 'desc',
      valueType: 'textarea',
    },
    
  ];
  handleDataImport(){

  }
  handleDataExport(){

  }
  render() {
    return (
      <div>
        
        <HighPerformTable<any>
          ref={(ref)=>this.actionRef=ref}
          toolBarRender={() => [
            <Button type="primary" onClick={() => this.actionRef.handleModalVisible(true)}>
              <PlusOutlined /> 新增学生
            </Button>
          ]}
          columns={this.clomns}
        />
      </div>
    );
  }
}

export default connect()(ClassDetailes);
